<%@ page language="java" import="java.util.*" import="java.text.SimpleDateFormat" pageEncoding="UTF-8"%>
<%@ page import="com.bluesky.light.user.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	// check if the user is login
	User u = (User)session.getAttribute("user");
	if (u == null) {
		response.sendRedirect("index.jsp");
	}	
	String name = u.getName();
%>
<%
	
	String action = request.getParameter("action");
	
	if (action != null && action.trim().equals("changepwd")) {

		String pwd = request.getParameter("pwd");
		String newpwd = request.getParameter("newpwd");
		if (pwd.trim().equals(u.getPwd())) {
			u.setPwd(newpwd);
			UserService.getInstance().updatePwd(u);
		}
		response.sendRedirect("user_pwdModify.jsp");
		return;
	}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>light - change info</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/main.css" rel="stylesheet" type="text/css" />
	
	<script language=JavaScript  src="js/checkpassword.js"> 
	</script>

  </head>
  
  <body>
	<!-- header -->
	<div id="header">
		<div id="logo"><img src="images/logo_small2.png"/></div>
	</div>
	<!-- // header -->
	<!-- nav -->
	<div id="nav">
	</div>
	<!-- // nav -->
	<!-- container -->
	<div id="container">
		<!-- contents -->
		<div id="contents">
	    	<div id="menu">
	        	<div>
	        		<div id="user_info">
	            		<img src="develop/user_icon.jpg"/> 
	            		<b>User</b>
	           		</div>
	           		<div>
	           		<%=name%>
	           		</div>
	            </div>
	            <div>
	            	<%SimpleDateFormat sdf = new SimpleDateFormat("EEE, yyyy-MM-dd", new Locale("US"));%><%=sdf.format(new Date())%><br></br>
	            </div>	
	        	<ul>
	            	<li><a href="home.jsp"><img src="images/news.png" /> Health News</a></li>
					<li><a href="user_subscribe.jsp"><img src="images/surscribe.png" /> Appointment</a></li>
					<li><a href="user_history.jsp"><img src="images/account.png" /> Health History</a></li>
					<li><a href="user_hospitalSearchOnMap.jsp"><img src="images/photo.png" /> Searching Hospital</a></li>
					<li><a href="user_bodyCheckResult.jsp"><img src="images/surscribe.png" /> Body Check Result</a></li>
					<li><a href="user_infoModifyInput.jsp"><img src="images/account.png" /> Account Management</a></li>
					<li><a href="index.jsp"><img src="images/account.png" /> Logout</a></li>
					
	            </ul>
	        </div>
	        <div id="main-cont">
	        	<div class="bodycheck">
  <div id="body_check_table">
    <div class="title">
    </div>
    <div id="record1">
      <table width="589" border="1">
      <div>
      	<caption><h2><span class="STYLE4"><br>body check result</span></h2></caption>
      </div>
        <tr>
          <th width="277" scope="col"><span class="STYLE3"> Medicine </span></th>
          <th width="296" scope="col"><span class="STYLE3">Surgical</span></th>
          </tr>
        <tr>
          <td height="347"><table width="277" border="1" id="map_canvas">
            <tr>
              <td width="130" scope="col">Height </td>
              <td width="131" scope="col">180 cm</td>
            </tr>
            <tr>
              <td> weight </td>
              <td>90 kg</td>
            </tr>
            <tr>
              <td height="44">Heart rate </td>
              <td>60 /min</td>
            </tr>
            <tr>
              <td height="30">Blood pressure</td>
              <td>70/140 mmHg</td>
            </tr>
            <tr>
              <td>Chest</td>
              <td>100</td>
            </tr>
            <tr>
              <td>Heart,vessels</td>
              <td>normal</td>
            </tr>
            <tr>
              <td>Lung</td>
              <td>normal</td>
            </tr>
            <tr>
              <td>Abdomen </td>
              <td>normal</td>
            </tr>
            <tr>
              <td>Liver, spleen</td>
              <td>normal</td>
            </tr>
            <tr>
              <td>Nervous system</td>
              <td>normal</td>
            </tr>
            <tr>
              <td>Other</td>
              <td>&nbsp;</td>
            </tr>
            
          </table></td>
          <td><table width="296" border="1">
            <tr>
              <td width="170" scope="col">Spine ,limbs</td>
              <td width="110" scope="col">good</td>
            </tr>
            <tr>
              <td>Anus</td>
              <td>good</td>
            </tr>
            <tr>
              <td> Genitalia</td>
              <td>good</td>
            </tr>
            <tr>
              <td>Skin disorders</td>
              <td>good</td>
            </tr>
            <tr>
              <td>Other</td>
              <td>&nbsp;</td>
            </tr>
          </table></td>
          </tr>
      </table>
      <table width="589" border="1">
        <tr>
          <th width="609" scope="col"><span class="STYLE3">ENT</span></th>
        </tr>
        <tr>
          <td><table width="577" border="1">
              <tr>
                <td width="53">Vision</td>
                <td width="508"><table width="507" border="1">
                    <tr>
                      <td width="120">Eyesight </td>
                      <td width="94">left : 200<br />
                        right : 200 </td>
                      <td width="95">Trachoma</td>
                      <td width="170">no</td>
                    </tr>
                    <tr>
                      <td> Vision correction </td>
                      <td>left : 50<br />
                        right : 50</td>
                      <td>Resolution</td>
                      <td>normal</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td>Ear</td>
                <td><table width="508" border="1">
                    <tr>
                      <td width="82"> Hearing </td>
                      <td width="123">left:normal<br />
                        right:normal </td>
                      <td width="92"> Ear diseases </td>
                      <td width="183">NO</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td>Nose</td>
                <td>normal</td>
              </tr>
              <tr>
                <td>Throat</td>
                <td>normal</td>
              </tr>
              <tr>
                <td>Mouth</td>
                <td>normal</td>
              </tr>
              <tr>
                <td height="50">Teeth</td>
                <td>normal</td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="589" border="1">
        <tr>
          <th width="269" scope="col"><span class="STYLE3">x-ray</span></th>
          <th width="304" scope="col"><span class="STYLE3">ECG</span></th>
        </tr>
        <tr>
          <td><img src="images/x_ray.jpg" width="229" height="220" /></td>
          <td><img src="images/ecg.jpg" width="304" height="166" /></td>
        </tr>
      </table>
      <p align="right"><br>check date : 2011-11-11</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </div>
    <div id="record2">
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </div>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
  </div>
</div>
	        </div>
	    </div>
	    <!-- // contents -->
	</div>
	<!-- // container -->
	<div id="footer">
		<div id="bs_stdio">
	    	©2011-2011 www.bluesky.com.mo All Rights Reserved<br/>
	    	<img src="images/bluesky_logo.png" />
	    </div>
	</div>
  </body>
</html>
